<?php
/**
 *
 * 回调类
 * @author widyhu
 *
 */
namespace LancerWechat\Pay;

class WechatPayNotifyCallback extends WechatPayNotify
{
    private $config;

    /**
     * @param array $config 设置配置
     */
    public function setConfig(array $config)
    {
        $this->config = $config;
    }

    public function callback(callable $function, array $config = null)
    {
        $order = $this->Handle($config ? $config : $this->config);
        call_user_func_array($function, [$order, $this]);
    }
}